home *** CD-ROM | disk | FTP | other *** search
- ===========================================================================
- BBS: The Abacus * HST/DS * Potterville, MI
- Date: 02-24-93 (17:35) Number: 112
- From: LEO VILDOSOLA Refer#: 6
- To: KEVIN LAM Recvd: NO
- Subj: DISABLING CTRL-ALT-DEL? Conf: (36) C Language
- ---------------------------------------------------------------------------
- KL>(Fragment of code to disable CTRL-ALT-DEL)
-
- KL>Anyways, do you know if there is a similar function to intercept the soft
- KL>reboot? Say, something that would let me close files and do a graceful exit
- KL>before rebooting...
-
- KL>If anybody can find anything it would be appreciated.
-
- I just saw your message with interest. I have been writing interceptors
- for a little bit now so I decided to give this one a try. I wrote it in
- assembler and I am posting the assembler code for this ISR. If you are
- not familiar with ASM code I will be happy to rewrite it in C. It was
- just easier to test it in ASM since I already had routines for writing
- interceptors in ASM.
-
- ISR starts here, in C you would use the interrupt keyword ----
-
- push es
- push ax
- ; read scan code
- in al,60h
- ; is it the DEL key?
- cmp al,53h
- ; no: call old interrupt
- jnz old_kbd_ISR
- ; yes: read shift status from BIOS data area
- xor ax,ax
- mov es,ax
- mov al,es:[417h]
- ; mask out Ctrl-Alt keys
- and al,00001100b
- ; were they pressed?
- cmp al,12
- ; no: call old interrupt
- jnz old_kdb_ISR
- ; yes: eat key and acknowledge hardware interrupt
- in al,61h
- mov ah,al
- or al,80h
- out 61h,al
- mov ah,al
- out 61h,al
- mov al,20h
- out 20h,al
- ; return
- pop ax
- pop es
- iret
- old_kdb_ISR:
- ; chain to old interrupt
- pop ax
- pop es
- jmp ORIG_INT09h
-
- ISR stops here ----
-
- All you have to do is use in-line assembly in your C program to hook to
- INT 09h and that's it. Again, if you do prefer C code for this let me
- know. I'll be glad to set it up for you but you will have to do the
- testing.
-
- G'd day!
- Leo Vildosola
-
- * OLX 2.1 TD * Chicken heads are the chief food of captive alligators.
- --- FidoPCB v1.4 beta
- * Origin: XON/XOFF Information Service - Montreal - USENET! (1:167/159)
- SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
- SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 575 950 203/23 209/209
- SEEN-BY: 239/1004 280/1 390/1 396/1 5 15 730/6 2270/1 3603/20
-